package com.zhibang.mapstruct;

import com.zhibang.entity.Menu;
import com.zhibang.vo.IndexMenuVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @autor 流萤微微
 * @date 2025年03月06日 9:18
 */
@Mapper
public interface MenuMapstruct {
    MenuMapstruct instance = Mappers.getMapper(MenuMapstruct.class);

    @Mapping(source = "name", target = "title")
    @Mapping(source = "href", target = "url")
    IndexMenuVo toIndexMenuVo(Menu menu);

    List<IndexMenuVo> list(List<Menu> menus);
}
